package com.eight.cloud.job.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.eight.cloud.job.entity.ExecutionJobEntity;
import com.eight.cloud.job.model.dto.ExecutionJobQueryDto;
import com.eight.cloud.job.model.vo.JobDataMapVo;
import com.eight.cloud.mybatisplus.mapper.SuperMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @InterfaceName: ExecutionJobMapper
 * @Author: TXC
 * @Date: 2025-02-25 10:08
 **/
@Mapper
public interface ExecutionJobMapper extends SuperMapper<ExecutionJobEntity> {
    /**
     * 获取JobDataMap
     * @param uuid 执行任务id
     * @return JobDataMap
     */
    JobDataMapVo fetchJobDataMap(String uuid);

    /**
     * 查询所有可执行任务
     * @return List<JobDataMapVo>
     */
    List<JobDataMapVo> fetchAllJobDataMap();

    /**
     * 查询所有可执行任务
     * @param page 数据容器
     * @param queryDto 查询条件
     * @return List<JobDataMapVo>
     */
    List<JobDataMapVo> fetchPageJobDataMap(IPage<JobDataMapVo> page, @Param("condition") ExecutionJobQueryDto queryDto);
}
